from rest_framework import serializers

from splits.models import Spit


class SplitSerializer(serializers.ModelSerializer):
    userid = serializers.PrimaryKeyRelatedField(read_only=True)
    avatar = serializers.ReadOnlyField(allow_null=True, read_only=True)
    nickname = serializers.CharField(allow_null=True, read_only=True)
    collected = serializers.BooleanField(read_only=True, default=False)
    hasthumbup = serializers.BooleanField(read_only=True, default=False)

    class Meta:
        model = Spit
        fields = '__all__'
